<?php $arr = Works::getTypesList();?>
<?php if(isset($works)): ?>
    <select name='works[type]'>
<?php else: ?>
    <select name='filters[type]'>
<?php endif; ?>
    <option><?php echo __('choose') ?></option>
    <?php foreach( $arr as $key => $type ): ?>
        <?php $selected = '';?>
        <?php if(isset($works) && ($type == $works->getType())){ $selected = 'selected'; }?>
        <?php if( ($type == $sf_request->getParameter('filters[type]')) ){ $selected = 'selected'; }?>
        <option value='<?php echo $type; ?>' <?php echo $selected; ?>>
            <?php echo $key; ?>
        </option>
    <?php endforeach; ?>
</select>